import {instance} from "./request";
const baseURL = '/user'
export function loginAdmin(data) {

  return  instance.post(baseURL+ '/admin/login',data)
  //  request({
    
  // }).then(res=>console.log(res))
}

export function getUserList(data=null) {

  return  instance.get(baseURL+ '/users',data)
  //  request({
    
  // }).then(res=>console.log(res))
}

export function updateUser(data=null) {

  return  instance.put(baseURL+ '',data, {headers:{
    'Content-Type': 'application/json'}})
  //  request({
    
  // }).then(res=>console.log(res))
}



export function deleteUserById(id,data=null) {

  return  instance.delete(baseURL+ '/'+id,data
  )
}

export function getUserListBypage(currentPage =1,pageSize = 10 ,data=null) {

  return  instance.get(baseURL+`/usersByPage/${currentPage}/${pageSize}`)
}

export function getUserListBypageByLike(currentPage =1,pageSize = 10 ,data=null) {
  let {type,info} = data;

  return  instance.get(baseURL+`/usersByPage/${currentPage}/${pageSize}/${type}/${info}`)
}
